package main

import (
	"fmt"
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/mysql"
)
type UserInfo struct {
	gorm.Model
	Name string `gorm:"name:"`
	Gender string  `gorm:"gender:"`
	Hobby string    `gorm:"hobby:"`
}


func main() {

	db, err := gorm.Open("mysql", "root:123456qwe@(127.0.0.1:3306)/test?charset=utf8mb4&parseTime=True&loc=Local")
	if err != nil {
		panic(err)
	}
	defer db.Close()
     u:=UserInfo{}
	db.Delete(&UserInfo{},5)
     db.Find(&u,3)
     fmt.Println(u.Name)

}